package com.bailong.administrator.ausedcar.ui.biblefragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by wlpc on 16/9/6.
 */
public class BiblePagerAdapter extends FragmentPagerAdapter {

    private List<Fragment> fragmentlist;
    private String[] title;

    public BiblePagerAdapter(FragmentManager fm, List<Fragment> list, String[] title) {
        super(fm);
        this.fragmentlist = list;
        this.title = title;
    }

    @Override

    public int getCount() {
        return fragmentlist.size();
    }


    @Override
    public Fragment getItem(int position) {
        return fragmentlist.get(position);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title[position%title.length];
    }
    public void reloadData(List list) {
        fragmentlist=list;
        notifyDataSetChanged();
    }
}
